import service from './index';

export const loginApi = (info) => service.post('sys/login', info); //登录
export const getUserInfoApi = () => service.post('sys/getMySelf'); //获取登录用户信息

//********************************* 字典API *********************************
//         special_subject_type	专题项目类型
//         stu_grade	年级
//         stu_class	班级
//         course_type	课程类型
//         semester	学期
//         course_system_type	课程体系
export const getDicValueApi = (info) =>
  service.post('sysDic/getDicValue', info);
export const getAllDicApi = (info) =>
  service.post('sysAccount/getAllDic', info);

//***************************************************************************

//********************************* 组织管理 *********************************
export const getSysCourseApi = (info) =>
  service.post('schCourse/getPage', info); //课程体系列表
export const getCollegesAndMajorApi = (info) =>
  service.post('sysDept/getAll', info); // 学院||专业
export const getTreeApi = () => service.post('sysDept/selectTree'); // 学院,专业树
export const addCollegeOrMajorApi = (info) =>
  service.post('sysDept/insert', info); // 增加 学院||专业
export const editCollegeOrMajorApi = (info) =>
  service.post('sysDept/update', info); // 修改 学院||专业
export const delCollegeOrMajorApi = (info) => service.post('sysDept/del', info); // 删除 学院||专业
export const getOneByIdApi = (info) => service.post('sysDept/getOne', info); // 查询单一 学院||专业
export const getMajorStudentApi = (info) =>
  service.post('sysDept/getMajorStudent', info); // 查询专业下学生
export const getMajorTeacherApi = (info) =>
  service.post('sysDept/getMajorTeacher', info); // 查询专业下学生
export const getSysAccountApi = (info) =>
  service.post('sysAccount/getPage', info); // 查询账号
export const addSysAccountApi = (info) =>
  service.post('sysAccount/insert', info); // 添加账号
export const updateSysAccountApi = (info) =>
  service.post('sysAccount/update', info); // 添加账号
export const delSysAccountApi = (info) => service.post('sysAccount/del', info); // 添加账号

//***************************************************************************

//********************************* 课程体系 *********************************

export const getLessonsApi = (info) => service.post('schCourse/getAll', info); //课程体系列表
export const getSchCourse = (info) => service.post('schCourse/getOne', info); //获取课程信息

export const getMyLessonsApi = (info) =>
  service.post('schCourse/getPage', info); //课程体系列表,我有权限的
export const getLessonsByPageApi = (info) =>
  service.post('schCourse/searchCourse', info); //课程体系列表
 export const getChapterBySchCourseId = (info) =>
  service.post('schCourseChapter/getPage', info); //根据课程id获取章节
export const getSchCourseKnowledgeBySchCourseChapterId = (info) =>
    service.post('schCourseKnowledge/getPage', info); //根据章节id获取知识点

export const getSchCourseResourceBySchCourseKnowledgeId = (info) =>
    service.post('schCourseResource/getPage', info); //根据二级知识点查询资源
 export const download = (key) =>
    service.get('fileStore/download?key='+key,{responseType: 'blob'} ); //下载附件

export const schCourseResourceInsert = (info) => service.post('schCourseResource/insert', info); // 添加资源
export const schCourseResourceUpdate = (info) => service.post('schCourseResource/update', info); // 修改资源
export const schCourseRef = (info) => service.post('schCourseRef/getPage', info); // 分页-各种关系
export const schCourseRefInsert = (info) => service.post('schCourseRef/insert', info); // 新增先修课程
export const schCourseRefInsertSupport = (info) => service.post('schCourseRef/insertSupport', info); // 新增支撑课程
export const schCourseRefInsertKnowledgeApplyFirst = (info) => service.post('schCourseRef/insertKnowledgeApplyFirst', info); // 新增 一级知识的应用于
export const schCourseRefInsertKnowledgeApplySecond = (info) => service.post('schCourseRef/insertKnowledgeApplySecond', info); // 新增 二级知识的应用于
export const schCourseRefInsertKnowledgeDependsFirst = (info) => service.post('schCourseRef/insertKnowledgeDependsFirst', info); // 新增 一级知识的依赖于
export const schCourseRefInsertKnowledgeDependsSecond = (info) => service.post('schCourseRef/insertKnowledgeDependsSecond', info); // 新增 新增 二级知识的依赖于

export const del = (info) => service.post('schCourseRef/del', info); // 删-各种关系

export const addLessonApi = (info) => service.post('schCourse/insert', info); // 添加课程


export const updateLessonApi = (info) => service.post('schCourse/update', info); // 添加课程
export const deleteLessonApi = (info) => service.post('schCourse/del', info); // 添加课程
export const addTeachersApi = (info) =>
  service.post('schCourse/addTeacher', info); // 添加老师
  export const addStudentsApi = (info) =>
  service.post('schCourse/addStudent', info); // 添加学生

//***************************************************************************

//********************************* 课程章节 *********************************

export const addSectionApi = (info) =>
  service.post('schCourseChapter/insert', info); //添加课程章节
export const deleteSectionApi = (info) =>
  service.post('schCourseChapter/del', info); //删除课程章节
export const editSectionApi = (info) =>
  service.post('schCourseChapter/update', info); // 修改课程章节
export const getSectionApi = (info) =>
  service.post('schCourseChapter/getPage', info); //获取章节

  export const searchCourseChapter = (info)=>service.post('schCourse/searchCourseChapter',info)//章节列表
  export const searchCourseKnowledge = (info)=>service.post('schCourse/searchCourseKnowledge',info)//一级知识列表
  export const searchCourseKnowledgeSecond = (info)=>service.post('schCourse/searchCourseKnowledgeSecond',info)//二级知识列表
  export const searchCourseResource = (info)=>service.post('schCourse/searchCourseResource',info)//资料列表
  export const searchCourse = (info) =>
  service.post('schCourse/searchCourse', info); //新获取课程
export const getSectionByIdApi = (info) =>
  service.post('schCourseChapter/getOne', info); // 获取章节详情

//***************************************************************************

//********************************* 课程章节知识 *********************************

export const addKnowledgeApi = (info) =>
  service.post('schCourseKnowledge/insert', info); //添加知识
export const deleteKnowledgeApi = (info) =>
  service.post('schCourseKnowledge/del', info); //删除知识
export const editKnowledgeApi = (info) =>
  service.post('schCourseKnowledge/update', info); // 修改知识
export const getKnowledgeApi = (info) =>
  service.post('schCourseKnowledge/getPage', info); //获取知识
export const getKnowledgeByIdApi = (info) =>
  service.post('schCourseKnowledge/getOne', info); //获取知识详情

//******************************************************************************

//********************************* 字典 *********************************
// export const getKnowledgeAllApi = (info) => service.post('schCourseResource/getAll',info); // 知识字典
export const getKnowledgeAllApi = (info) =>
  service.post('schCourseKnowledge/getAll', info); // 知识字典
export const getSectionAllApi = (info) =>
  service.post('schCourseChapter/getAll', info); // 章节字典
export const getLessonAllApi = (info) => service.post('schCourse/getAll', info); // 课程字典

//**********************************知识图谱********************************************
export const getSchCourseTree = (info) =>
  service.post('schCourse/getTree', info); //知识查查首页树
export const neo4j = (info) =>
  service.post('neo4j/search', info); // 章节字典

